package com.ruoyi.premises.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Result {
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 消息内容
     */
    private String msg;
    /**
     * 返回的内容
     */
    private Object data;

    public static Result success(){
      return  new Result(200,"操作成功",null);
    }
    public static Result success(Object data){
        return  new Result(200,"操作成功",data);
    }

    public  static  Result fail(){
        return  new Result(501,"操作失败",null);
    }
    public static  Result fail(Integer code,String msg){
        return  new Result(code,msg,null);
    }
}
